include('shared.lua')

// Draw

function ENT:Draw()
	self.Entity:DrawModel()
end

// Think (Thanks to Malawar for this)

local Time = 0

function ENT:Think()
	local Cur = CurTime()
	
	if (Time < Cur) then
		local Off = self.Entity:LocalToWorld(Vector(0, 0, self.Entity:OBBMins().z))
		
		local Ang = (Off - self.Entity:GetPos()):GetNormalized()
		
		local Emitter = ParticleEmitter(Off)
		
		local Particle = Emitter:Add("particles/smokey", Off)
		
		Particle:SetVelocity(Ang * math.Rand(-16, -32))
		Particle:SetDieTime(2)
		Particle:SetStartAlpha(math.Rand(75, 100))
		Particle:SetStartSize(math.Rand(16, 32))
		Particle:SetEndSize(math.Rand(8, 16))
		Particle:SetRoll(math.Rand(-0.1, 0.1))
		Particle:SetColor(200, 200, 200)
		
		Emitter:Finish()
		
		Time = Cur + 0.015
	end
end